package com.hnevc.caoliuye;

import java.util.Scanner;

public class Homework {
    public static void main(String[] args) {
        System.out.println("请输入年：");
        Scanner y = new Scanner(System.in);//输入年份
        int year = y.nextInt();
        System.out.println("请输入月：");
        Scanner m = new Scanner(System.in);//输入月份
        int month = m.nextInt();
        int a =28;//不是闰年的二月份的天数
        switch(month) {
            case 1:
            case 3:
            case 5:
            case 7:
            case 8:
            case 10:
            case 12:
                System.out.println("本月有31天");//有31天的月份
                break;
            case 4:
            case 6:
            case 9:
            case 11:
                System.out.println("本月有30天");break;//有30天的月份
            case 2:

                if(year%4==0&&year%100!=0||year%400==0) {//闰年
                    a = 29;

                }System.out.println("本月有"+a+"天");break;//如果2月是闰月，输出29天
        }
    }
}
